﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkflowCore2210A.Domain.Model;

namespace WorkflowCore2210A.Domain
{

    /// <summary>
    /// 仓储接口类
    /// </summary>
    /// <typeparam name="T">实体基类泛型</typeparam>
    public interface IBaseRepository<T> where T : BaseEntity
    {
        /// <summary>
        /// 泛型添加方法
        /// </summary>
        /// <param name="t">实体</param>
        /// <returns>受影响行数</returns>
        int Add(T t);
        /// <summary>
        /// 泛型修改方法
        /// </summary>
        /// <param name="t">实体</param>
        /// <returns>受影响行数</returns>
        int Update(T t);
        /// <summary>
        /// 泛型查询方法
        /// </summary>
        /// <returns>满足条件的数据</returns>
        IQueryable<T> GetAll();
        /// <summary>
        /// 泛型通过id查单条数据方法
        /// </summary>
        /// <param name="id">主键编号</param>
        /// <returns>单条数据</returns>
        T GetModel(int id);
    }
}
